package com.wlyuan.open.scanner.utils.enums.order;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 新老系统订单签收类型
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum OrderSignTypeEnum implements NamedValue<Integer> {

    INIT(0, 0, "初始化签收"),
    SCAN_SIGN(1, 1, "扫码签收"),
    OTHER(2, 0, "平台签收"),
    DRIVER(3, 4, "个体司机签收"),
    WXFHF(5, 5, "发货方小程序签收"),
    WXCYF(6, 6, "承运方小程序签收"),
    WXSHF(7, 7, "收货方小程序签收"),
    DEVICE_AUTO(99, 99, "电子回单自动签收");

    private final Integer value;
    private final Integer newValue;
    private final String name;


    private static final Map<Integer, OrderSignTypeEnum> MAP = new NamedValueMap<>(OrderSignTypeEnum.class);

    public static OrderSignTypeEnum fromValue(Integer value) {
        return MAP.get(value);
    }

    public static boolean isScanSign(Integer val) {
        return SCAN_SIGN.getValue().equals(val);
    }

}
